# Full text of "VIC Graf (1982)(Commodore)"

## See other formats

```:

HOW TO USE THE MATHEMATICAL
SUPPORT PROGRAM:

GRAPHICAL ANALYSIS

BY
PER-ERICH SMEDBERG

INTRODUCTION

The intention of this program, is to serve as a matematical and pedagogic
aid for studying complicated equations and functions by their graphs.

As most equations can be reformulated to equate zero, their real-number
solutions can be considered to be "intersections" between the x-axis and
the graph of a function, defined by the left part of the reformulated
equation. I.e. solution of equations turns into graphical analysis!

The program allows you to define this function and plots the graph in high
resolution, within an X-axis-range, which is also defined by you.

High resolution here means that the graph, within the specified range, "fills
out" all of the display, thereby forcing both axes (and their origin) to adapt
to the graph, not the other way around! (A definit advantage compared to
programs using a fixed origo!)

This means, that also graphical areas, far from the axes origin, can be
studied in detail by a "blow-up" of a specified range.

So you can move to any part of the graph and have it plotted in any size,
depending on the range you specify.

If you start by specifying a side range, you will expose interesting parts of
the graph, which later can be studied in detail by "blow-ups" of shrinked
intervals. (Watch out for vast ranges, when it comes to plotting periodical
functions though!)

To further increase precision in determining intersections and extreme
points, optional routines, implimented in the program, will precisize them

Furthermore, there is a routine for computing the integral of the function
within a range, specified by you. All of these analytic options, can be
required with the plotted graph left on the display. What this means in
facilitating your choice of ranges, is obvious!

GETTING STARTED & OPTION REVIEW

The Program is stored in the ROM-memory of the cartridge.

This means, that it becomes part of VIC's operational system, the very

moment you plug the cartridge into the expansion slot of the computer!

The advantage of this is obvious', No delays reading the program and no
risk, having it spoiled by improper handling or longtime-storing!

So get started by plugging it in and switch on the computer!

The program starts immediatly. The first action from the computer is a
prompting request:

Y(X)=

tDEFINE FUNCTION t

You can now print the function you want to study! As an exercise, choose for
instance: SIN(X)

Notice that your text appears immediately to the right of the equals sign.

You can correct misspellings etc. as usual with the DELETE- and

INSERTkeys, but any attempt to erase the Y(X)= -expression or printing to

the left of it, will only restart the operation!

For defining the function, there are three and a half line, i.e. 76 character

When you have finished your definition, you must let VIC know this, by

pressing the 'RETURN'-key. (Alternatively by giving a final colon or writing

"past" the 76:th position.) On the display now appears a menu, presenting

all the service-options:

FOR SERVICE PRESS:

Fl = PLOT THE GRAPH.
F2 = NEW FUNCTION.
F3 = AXIS INTERSECT .
F4 = EXPOSE FUNCTION
F5 = FIND MAX. &MIN.
F6 = CORR. IN EQUAT ..
F7 = EVAL. INTEGRAL .

By pressing one of the yellow function keys you receive the announced

operation.

Naturally, you now want to see the graph of the chosen (SINE-)function! To

do that, press the Fl-key!

The display is erased and on the top line appears the request:

STATE RANGE: (XO,XN)=?

Let's choose a symmetrical range, where you are familiar with the sine-
graph' Print: —3.14,3.14, and press the 'RETURN'-button!

Now there will be a pause, while VIC does some calculating. So appear the
coordinat-axes, immediately followed by the plotting of a graph. This is
what you see:

NEW RANGE? YES NO
1

3.14

Notice that VIC always prompts with a new question on the top line of the

display, after an operation is finished!

Too see the flexibility of the program, you can reply by pressing the Y(es)-

button!

The request:

STATE RANGE: (XO,XN)=?

appears again. This time, choose the range: — 3.14,6.28 and watch what

happens!

The result:

NEW RANGE? YES NO
1

6.28

As you see, the coordinat-axes have been adapted to the expanded graph,
which is covering maximum display.

But what would happen if the current graph is lacking intersections with the
axes? Will their information of coordinates be missing then?

Let us make a test! First you answer the request for new range with a Y(ES).

Then you specify it by: — 3, — 1

Result:

NEW RANGE? YES NO

The axes are still there, but not any more in their capacity of system-axes.

They now only serve as "fram-dials" to support coordinates.

It's important to separate these concepts, when you are using the analytical

options of the program!

To become familiar with the other options of the program, we now refuse

the offer from another graph with a N(O).

The offer is immediately replaced by the question:

WANT GRAPHICAL DATA?

Let's agree by pressing the Y-key.

On the same line, the first option is now offered:

WANT AXIS INTERSECT.?

Again we agree, by pressing the Y-key. This results in a request on the next
line:

STATE AN APPROX. VALUE

As we normally, at this stage, have the plotted graph on the display, the
X-value of intersection can easily be estimated.

Let's in our case, make the estimation: X=3. Print the figure and press
'RETURN'! The text on the line disappears and is replaced by:

INTERSECT. X=3.142

and the question: WANT AXIS INTERSECT.? returns on the top line.You can
now proceed, specifying intersections, but we suggest that you press the
N(0)-button!

4

Before resuming the course of events, a comment on the intersection
routine:

As you saw before, when the system-axes can't connect to the current
graph, they are replaced by "frame-dials", giving the coordinates of it.

As the graph fills up all of the display, there will be intersection between it
and the frame-dials. Don't misstake these for intersections with the system-
axes! If you are uncertain about the nature of intersections, the presence (or
absence) of axis-origins (zero-values) will show their true nature!
We now return to the development of events, (after turning down the
renewed offer for intersections.)

On the top line the option is replaced by the offer:

WANT EXTREMAL POINTS?

The spotting, of local maxima and minima of a function, is a must in
graphical analysis, so of course, such an option belongs in the program!
Press the Y-key and see VIC requesting:

GIVE RANGE OF SEARCH

Let's scan the range X=0 to X=6.28. Print 0,628 and confirm it by pressing
'RETURN'!

The computer now will work for a while, successivly presenting the
extremas it finds:

MAX.IN (1.57, 1)
MIN IN (4.71,-1)
TOP VALUE=1
LEAST VALUE=-1

After the last line, on the top reappears:

WANT EXTREMAL POINTS?

Notice that in the contest for "LEAST- &TOPVALUE-ship", the endpoints of

This is important, when your problem is to find "best or worst" values,

within a limited area of existence for the X-variabel.

When we have come this far in the program, the graph is overwritten to the

point, where VIC chooses to erase the display, when you answer the last

question with a N(O).

If you had neglected the option for extremes just now,then, as a last option,

WANT AN INTEGRAL?

If you then press the Y-key, it continues with an "INPUT"-request:

RANGE OF INTEGR.=?

on the top line.

Instead, now the MENU returns on the display. To accomplish the same

procedure, from this basis, you instead press the F7-key!

Let's evaluate the area of asine-"hunch"! Answer the request, by giving the

range: 0, 3.1416

The answer appears almost immediately when you press RETURN':

r3.1416
) Y(X)DX = 2

FOR THE INTEGRAND:
Y(X) = SIN(X)

Which honours the SIMPSON-approximation, responsible for the

evaluation!

The offer: WANT AN INTEGRAL? returns on the top line. The MENU

We have now given a review of the analytical options, implemented in the

program.

As you see in the MENU, there are also a few routines for editing and

checking the function. .

By pressing F4 (= EXPOSE FUNCTION), you receive:

THE PRESENT FUNCTION:

Y(X) = SIN(X)

Press a key to get back to the MENU!

To facilitate fast corrections or exchange of parameters in the expression,

the routine F6 = CORR.IN EQUAL is implimented.

If you press the F6-key, the program returns to input-mode, with your

former function presented on the display, ready for editing or extension,

like it was when you defined it!

The CRSR-keys now enable you to move around within the equation, to

overwrite, erase or insert new figures and functions, aided by the INSERT- &

DELETE-keys etc.!

When you are ready, the new expression will be accepted, if you press

If instead, you prefer to define an altogether different function, — then

press F2 (= NEW FUNCTION).

This option erases the old expression on the display, before it turns into

input mode. Notice however, that the erasure will not be accepted, within

the program, until you press RETURN!

Before that, you are free to change your mind anytime. I.e. you can return

to the menu, by pressing the STOP-key, and the old expression still stands.

This possibility also exists during program execution. The only exception is

when you are inputing data.

If you should change your mind during an input, continue anyway, then

press RETURN followed by STOP!

Let's test editing our SINE-expression! Press F6 and see:

Y(X) =SIN(X)

appear on the display, with an invitingly flickering cursor under the S. Let

the cursor stroll down the expression and print an addition which changes

the function into: Y(X)=SIN(X)/X. Confirm it with a RETURN!

Convince yourself that the new expression has been accepted, by pressing

F4!

When plotting a graph, (within the range you have specified), the program

evaluates 160 evenly distributed points, which will be presented on the

display.

If you make the interval very vast, the distance between points will also be

large. So, if your function is periodic, don't expect that from your graph!

This program was not intended to substitute an highfrequency oscilloscope,

even if it can make a good model within proper ranges!

You often choose to study graphs within a "symmetric" range. This involves

a risk of discontinuities among the sampled points!

If, for instance, X=o is one of them, at the evolution of SIN(X)/X, the

program will crash, leaving a DIVISION by ZERO-message.

To avoid this kind of timeconsuming breakdowns, the program

automatically increases every chosen X by a billionth.

In most applications, this displacement won't cause any visible change in

the shape or situation of the graph.

To recieve a VERY FAST response in finding intersections, the "NEWTON-

RAPHSON"-method has been used. This method works on the condition,

that searching for the intersection starts from a point CLOSE TO IT!

If you don't give a "close enough" estimation of the intersection, the

method might fail. As the graph is very accurate, misestimations will be

rare.

We will now show you an application to the option.

FINDING REAL SOLUTIONS OF AN EQUATION

As an exampel we choose the solution of:

-X
e = X

This equation must first be reformulated into:

EXP(-X)-X=0

And we solve it, by studying the intersections of:

Y(X)=EXP(-X)-X

Activate the program according to the former descriptions. Print the
function and chose the option:

Fl=PLOTTHE GRAPH

On the request:

STATE RANGE: (XO,XN)=?

give the interval: 0,4 . As a result you receive this graph:

1

1-3.98

Choose the INTERSECTION routine and give the estimation 0.5,
suggested by the graph!
The computer precisezes:

INTERSECT. X = 0.567

Which is a correctly rounded solution to our equation!

& commodore

^COMPUTER